<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateUsersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('users', function (Blueprint $table) {
            $table->increments('id');
            $table->string('mobile', 11)->default('');
            $table->string('nickname', 30)->default('');
            $table->string('avatar_url', 250)->default('');
            $table->string('openid', 64)->unique();
            $table->enum('sex', ['1', '2', '3'])->default('3');
            $table->string('province', 120)->default('');
            $table->string('city', 120)->default('');
            $table->string('area', 120)->default('');
            $table->softDeletes();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('users');
    }
}
